package com.showcai.controller.versions;

import com.github.pagehelper.PageInfo;
import com.showcai.controller.base.BaseController;
import com.showcai.def.Constant;
import com.showcai.module.Versions;
import com.showcai.result.ResultObj;
import com.showcai.result.ReturnCode;
import com.showcai.service.VersionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by Baggio on 2017-7-3.
 */
@RequestMapping("/versions")
@Controller
public class VersionsContorller extends BaseController {

    @Autowired
    VersionsService versionsService;


    @RequestMapping(value = "/versionsList")
    @ResponseBody
    public String versionsList() {
        ResultObj resultObj = new ResultObj();
        Versions versions = versionsService.getLastVersions();
        resultObj.setCode(ReturnCode.SUCCESS.getCode());
        resultObj.setMsg(ReturnCode.SUCCESS.getMsg());
        resultObj.setData(versions);
        return resultObj.toJson();
    }
}
